//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.come.until;

import javax.swing.JComponent;
import javax.swing.JTree;
import javax.swing.tree.DefaultMutableTreeNode;
import org.come.entity.Friendtable;

public class JTreeData {
	private String strNode;
	private String path;
	private JComponent jcp;

	public JTreeData(String str, String imagePath) {
		this.strNode = str;
		this.path = imagePath;
	}

	public JTreeData(String str) {
		this.strNode = str;
	}

	public String getString() {
		return this.strNode;
	}

	public void setString(String strNode) {
		this.strNode = strNode;
	}

	public String getPath() {
		return this.path;
	}

	public void setPath(String path) {
		this.path = path;
	}

	public JComponent getJcp() {
		return this.jcp;
	}

	public void setJcp(JComponent jcp) {
		this.jcp = jcp;
	}

	public static void ShowFriendMsg(DefaultMutableTreeNode top, JTree jTree) {
		top.removeAllChildren();
		DefaultMutableTreeNode node1;
		if (UserMessUntil.getFriendtables() != null && UserMessUntil.getFriendtables().size() > 0) {
			int num = UserMessUntil.getFriendtables().size();
			node1 = new DefaultMutableTreeNode("大话精灵");
			DefaultMutableTreeNode node = new DefaultMutableTreeNode("我的好友[" + num + "]");

			for(int i = 0; i < num; ++i) {
				Friendtable friendtable = (Friendtable)UserMessUntil.getFriendtables().get(i);
				DefaultMutableTreeNode childNode = new DefaultMutableTreeNode(new JTreeData(friendtable.getRolename(), "img/head/s" + friendtable.getSpecies_id() + ".png"));
				node.add(childNode);
			}

			top.add(node1);
			top.add(node);
			if (jTree != null) {
				jTree.updateUI();
			}

		} else {
			DefaultMutableTreeNode node = new DefaultMutableTreeNode("大话精灵");
			node1 = new DefaultMutableTreeNode("我的好友[0]");
			top.add(node);
			top.add(node1);
			if (jTree != null) {
				jTree.updateUI();
			}

		}
	}
}
